-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features #86
Merged
Merged
Features #86
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
==========================================
+ Coverage 90.06% 93.28% +3.22%
==========================================
Files 11 12 +1
Lines 805 1102 +297
Branches 86 101 +15
==========================================
+ Hits 725 1028 +303
+ Misses 58 54 -4
+ Partials 22 20 -2
☔ View full report in Codecov by Sentry. |
computablee
added
the
hacktoberfest-accepted
This PR was accepted as a Hacktoberfest PR
label
Oct 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue are you addressing?
Closes #39
How have you addressed the issue?
There has been a significant amount of refactoring done in the inner scheduler code to make this possible. This PR adds the
Wrappers.cs
file, which contains several new delegates and theForAction<T>
class. The methods inIter
now defer toForAction<T>.PerformLoop
to execute a chunk. The overhead should be negligible for non-collapsed loops. For collapsed loops, new control flow exists to un-flatten the indices from the scheduler into 2D, 3D, 4D, or even higher dimensional loops. This infrastructure exists with both non-reduction and reduction loops. New methods have been implemented into theParallel
class, includingForCollapse
,ForReductionCollapse
,ParallelForCollapse
, andParallelForReductionCollapse
, each with several overloads based on the collapse factor.How have you tested your patch?
New tests have been written, namely
Collapse_works
andReduction_collapse_works
. Both of these are passing.Additional work
This PR also creates the
benchmarks/
subfolder, which will be the home for benchmarking DotMP. For a performance-oriented library, I am utterly ashamed at the lack of benchmarking that has happened. I hope to useBenchmarkDotNet
to power benchmarks, but it is still a WIP.I have also changed the access modifier of
Lock._lock
frominternal
toprivate
. With the new API, there is no reason for_lock
to be internal.